package com.edu.scau.entity;



import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;

import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;

@Entity
@Table(name = "order_form")
public class OrderForm implements Serializable{
	@Id
	@Column(name = "order_form_id")
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Integer orderFormId;
	@Column(name = "create_time")
	private String createTime;
	
	@OneToMany(targetEntity=Sold.class, mappedBy="orderForm")
	private Set<Sold> solds;
	
	@ManyToOne(targetEntity = User.class)
	@Cascade(value = CascadeType.ALL)
	@JoinColumn(name = "user_id", referencedColumnName = "user_id")
	private User user;

	public Integer getOrderFormId() {
		return orderFormId;
	}

	public void setOrderFormId(Integer orderFormId) {
		this.orderFormId = orderFormId;
	}

	public String getCreateTime() {
		return createTime;
	}

	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}

	public Set<Sold> getSolds() {
		return solds;
	}

	public void setSolds(Set<Sold> solds) {
		this.solds = solds;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
	
	
	
}
